package state;

public class TurnStyleUsePattern {
	private static TurnStyleState lockedState = new LockedState();
	private static TurnStyleState unlockedState = new UnlockedState();
	
	private TurnStyleController controller;
	private TurnStyleState state = lockedState;
	
	public TurnStyleUsePattern(TurnStyleController action)
	{
		controller = action;
	}
	
	public void coin()
	{
	    state.coin(this);
	}
	
	public void pass()
	{
		state.pass(this);
	}
	
	public void setLocked()
	{
		state = lockedState;
	}
	
	public void setUnlocked()
	{
		state = unlockedState;
	}
	
	public boolean isLocked()
	{
		return state == lockedState;
	}
	
	public boolean isUnlocked()
	{
		return state == unlockedState;
	}
	
	public void thankyou()
	{
		controller.thankyou();
	}
	
	public void alarm()
	{
		controller.alarm();
	}
	
	public void lock()
	{
		controller.lock();
	}
	
	public void unlock()
	{
	    controller.unlock();
	}
	

}
